<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateMembersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('members', function (Blueprint $table) {
            $table->increments('id');
			$table->unsignedMediumInteger('shop_id')->default(0)->comment('门店ID');
			$table->unsignedMediumInteger('device_id')->default(0)->comment('设备ID');
			$table->string('member_no', 16)->default('')->comment('编号');
			$table->string('avatar', 32)->default('')->comment('头像');
			$table->string('name', 16)->default('')->comment('姓名');
			$table->boolean('gender')->default(0)->comment('1:男 2:女');
			$table->string('mobile', 16)->default('')->comment('手机号');
			$table->boolean('calendar')->default(0)->comment('1:公历 2:农历');
			$table->date('birthday')->default('')->comment('生日');
            $table->timestamps();
            $table->softDeletes();
			$table->index(['shop_id', 'device_id'], 'SidDid');
		});
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('members');
    }
}
